import java.io.File;
import java.io.IOException;

public class FileDemo3 {
    public static void main(String[] args) throws IOException, InterruptedException {
        File file=new File("hello.txt");
        file.createNewFile();
        System.out.println("文件创建成功！");
        Thread.sleep(3000);
        file.deleteOnExit();//
        System.out.println("吧文件标记成退出时候再删除的状态");
        Thread.sleep(3000);

    }
}
